<?
require_once 'config.inc.php'; 

if (empty($_SESSION["username"])){
	header("Location:./admin/login.php?referer=". $_SERVER['REQUEST_URI']);
}
if ($_GET['id']) {
	$id = intval($_GET['id']);
	$sql = "SELECT * FROM {$tablepre}blog WHERE id = $id ";
	$result=mysql_query($sql); 
	$enotes = mysql_fetch_array($result);
	
}
?>
<link rel="stylesheet" type="text/css" href="images/style.css">
<?php if($enotes){?>
<div class="note">

	<div class="title">
	日期:<?php echo  format_date($enotes[create_time]); ?>
    <?php if($enotes[update_time]){?>
    最后修改:<?php echo  format_date($enotes[update_time]); ?>
    <?php }?>
	<a href="admin/admin_blog.php?id=<?php echo $enotes[id] ?>">[编辑]</a>
	<a href="view_blog.php?id=<?php echo $enotes[id] ?>" target="_blank" >[新窗口查看]</a>
	<a href="admin/admin_blog.php?action=del&id=<?php echo $enotes[id] ?>" onclick="return confirm('Are you sure you want to delete?')">删除</a>]
	<a href="admin_blog.php" >[添加日志]</a>
    </div>
	<div class="content">
	<?php //echo html_entity_decode($enotes['content'],NULL,'UTF-8') ?>
	<?php echo $enotes['content']?>
	</div>

</div>
<a href="admin/admin_blog.php?id=<?php echo $enotes[id] ?>" >[编辑]</a>
<a href="view_blog.php?id=<?php echo $enotes[id] ?>" target="_blank" >[新窗口查看]</a>
<?php }else{?>
<div class="note">
无此内容
</div>
<?php }?>	
<?
require_once 'foot.inc.php';
?>